package com.qmds.patrolserver.plan.controller;


import com.qmds.common.core.annotation.NoLoginCheck;
import com.qmds.common.core.vo.R;
import com.qmds.patrolserver.plan.params.PatrolPageParam;
import com.qmds.patrolserver.plan.service.PatrolService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Patrol)表控制层
 *
 * @author makejava
 * @since 2024-09-09 16:41:10
 */
@RestController
@RequestMapping("/app/patrol")
public class PatrolController{
    /**
     * 服务对象
     */
    @Resource
    private PatrolService patrolService;

    /**
     * 分页查询所有数据*/
    @GetMapping("/page")
    @NoLoginCheck
    public R selectAll(PatrolPageParam pageParam) {
        return patrolService.selectAll(pageParam);
    }

    /**
     * 新增数据*/
    @PostMapping("/insertInfo")
    public R insert(@RequestBody PatrolPageParam patrol) {
        return patrolService.insertIfo(patrol);
    }

    /**
     * 类型统计*/
    @NoLoginCheck
    @GetMapping("/num")
    public R typeCount(){
        return patrolService.typeCount();
    }


}

